/*
**  (C) 2007 Camilo Viecco.  All rights reserved.
**
**  This file is part of Tdor, and is subject to the license terms in the
**  LICENSE file, found in the top level directory of this distribution. If you
**  did not receive the LICENSE file with this file, you may obtain it by
**  contacting the authors listed above. No part of Tdor, including this file,
**  may be copied, modified, propagated, or distributed except according to the
**  terms described in the LICENSE file.
*/

#ifndef HEADER_DH_H
#include <openssl/dh.h>
#endif
DH *get_dh512()
        {
        static unsigned char dh512_p[]={
                0xFF,0x61,0x71,0x3C,0x3E,0xA5,0x52,0x0B,0x49,0x20,0xCB,0x7A,
                0x0D,0xF9,0x7E,0xF1,0x0F,0x2D,0xA3,0x72,0x21,0xAF,0xF8,0xBE,
                0xBD,0x1D,0x8D,0xD4,0x78,0x5C,0x4D,0x4E,0x7D,0x11,0xC6,0x81,
                0x17,0x54,0x6B,0x9D,0xC2,0xB4,0x32,0xD4,0x56,0x78,0x94,0xDA,
                0xB0,0x1D,0x82,0xE6,0xF9,0xF1,0x88,0x1A,0x6B,0xEE,0x0A,0x76,
                0x25,0x22,0x72,0xC3,
                };
        static unsigned char dh512_g[]={
                0x05,
                };
        DH *dh;

        if ((dh=DH_new()) == NULL) return(NULL);
        dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
        dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
        if ((dh->p == NULL) || (dh->g == NULL))
                { DH_free(dh); return(NULL); }
        return(dh);
        }

DH *get_dh1024()
        {
        static unsigned char dh1024_p[]={
                0xDD,0xF7,0x85,0xCF,0x22,0x2B,0x65,0x1C,0xE6,0x08,0x1D,0xAF,
                0x88,0x05,0x8E,0x72,0xB4,0x8A,0xDD,0xCB,0x7F,0xB5,0x14,0x62,
                0x0E,0xB8,0x8B,0x25,0x52,0x33,0xF8,0x5F,0xDA,0xC1,0x6C,0x3E,
                0x92,0xD0,0x0F,0x4B,0x4F,0xE7,0x77,0xB9,0xAB,0x56,0x51,0x8D,
                0xC2,0xCC,0x39,0xA1,0x80,0xB6,0x51,0xF1,0xBA,0x8A,0x52,0x00,
                0x1B,0xE2,0xF5,0xE6,0x71,0x5A,0x26,0xDF,0x74,0x68,0x6E,0xBF,
                0xF7,0x79,0x53,0xCB,0xAC,0x37,0x85,0x17,0x74,0xBB,0x39,0xB1,
                0x52,0x2C,0xCF,0xDB,0x6A,0x9C,0xC8,0x24,0xD8,0xBB,0xC4,0x3F,
                0xA3,0x86,0x54,0x86,0xD8,0x14,0x33,0x98,0x68,0x08,0xDA,0xF0,
                0xDA,0xEC,0x45,0xAC,0x87,0x92,0x96,0x61,0x16,0xFD,0x94,0xBC,
                0xCB,0xDD,0xEE,0xDF,0x29,0x7E,0x07,0xC7,
                };
        static unsigned char dh1024_g[]={
                0x05,
                };
        DH *dh;

        if ((dh=DH_new()) == NULL) return(NULL);
        dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL);
        dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL);
        if ((dh->p == NULL) || (dh->g == NULL))
                { DH_free(dh); return(NULL); }
        return(dh);
        }


